/*
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2024-03-22 13:36:46
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2024-03-22 13:44:33
 * @FilePath: \project-my\mytestApp\src\utils\Storage.ts
 * @Description: 
 */
import AsyncStorage from "@react-native-async-storage/async-storage";

/* 保存数据 */ 
export const saveStorage = async(KEY: string, VALUE: string) => {
    try {
        return await AsyncStorage.setItem(KEY, VALUE)
    } catch (e) {
        console.log(e)
    }
}

/* 读取数据 */ 
export const loadStorage = async(KEY:string) => {
    try {
       return await AsyncStorage.getItem(KEY) 
    } catch (error) {
        console.log(error)
    }
}

/* 删除数据 */ 
export const removeStorage = async(KEY: string) => {
    try {
        return await AsyncStorage.removeItem(KEY)
    } catch (error) {
        console.log(error)
    }
}